class Keben {
    public int minCostClimbingStairs(int[] cost) {
        int pre = 0,curr = 0;
        for(int i = 0;i< cost.length ;i++){
            int temp = curr;
            curr = cost[i] + Math.min(pre,curr);
            pre = temp;
        }
        return Math.min(pre,curr);
    }
}